Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose cloud accounts management endpoints #979

Merged
merged 6 commits into from
Sep 20, 2023
Merged

Conversation

mlabouardy
Copy link
Collaborator

@mlabouardy mlabouardy commented Sep 19, 2023

Problem

Currently, the onboarding wizard feature isn't connected to the backend. The goal of this PR is to expose the needed endpoints to plug the workflow.

Solution

I've exposed additional API endpoints to manage the onboarding and cloud accounts.

Changes Made

  • Exposed the following endpoints:
GET /is_onboarded
GET /cloud_accounts
POST /cloud_accounts
DELETE /cloud_accounts/{id}
PUT /cloud_accounts/{id}

How to Test

To know if the onboarding wizard should be shown or not, the following API endpoint can be requested:
GET /is_onboarded
It returns the following payload:

{
   "onboarded": true
}

To list all connected cloud accounts:
GET /cloud_accounts
It returns the following response:

[
    {
        "id": 1,
        "provider": "AWS",
        "name": "Sandbox",
        "credentials": {
            "path": "/usr/bin/credentials",
            "profile": "default",
            "source": "CREDENTIALS_FILE"
        }
    },
    {
        "id": 2,
        "provider": "DigitalOcean",
        "name": "Production",
        "credentials": {
            "token": "TOKEN"
        }
    }
]

To add a cloud account:
POST /cloud_accounts
It expects the following payload:

[
    {
        "provider": "AWS",
        "name": "Staging",
        "credentials": {
            "path": "/usr/bin/credentials",
            "profile": "default",
            "source": "CREDENTIALS_FILE"
        }
    }
]

To delete a cloud account:
DELETE /cloud_accounts/{id}

To update a cloud account:
PUT /cloud_accounts/{id}

Checklist

  • Code follows the contributing guidelines
  • Changes have been thoroughly tested
  • Documentation has been updated, if necessary
  • Any dependencies have been added to the project, if necessary

@mlabouardy mlabouardy added this to the v3.1.1 milestone Sep 19, 2023
@mlabouardy mlabouardy marked this pull request as ready for review September 20, 2023 06:25
@mlabouardy mlabouardy merged commit f945f4e into develop Sep 20, 2023
2 checks passed
@mlabouardy mlabouardy deleted the feature/tech-1647 branch September 20, 2023 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant